package com.kb.design.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.kb.design.dto.CustomContactInfo;
import com.kb.design.dto.DesignOrderDetailDTO;
import com.kb.design.mapper.postgreSQL.ContractMapper;
import com.kb.design.service.CrmService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

@Service
@DS("master")
public class CrmServiceImpl implements CrmService {

    @Resource
    private ContractMapper contractMapper;


    @Override
    public List<CustomContactInfo> queryCustomContactInfo(String code) {
        if (Objects.nonNull(code)){
           return contractMapper.queryCustomContactInfo(code);
        }
        return Collections.emptyList();
    }

    @Override
    public DesignOrderDetailDTO querySaleInfo(String code) {
        if (Objects.nonNull(code)){
        return contractMapper.querySaleInfo(code);
        }
        return new DesignOrderDetailDTO();
    }
}
